import { post, get } from '@/http/index'
import type { ScheduleTemplateModel } from '@/type/ScheduleTemplate'
import { DeconstructionKvModel } from '@/utils/objUtils'
export async function getScheduleTemplate(pk: string) {
  return await get<ScheduleTemplateModel>("ScheduleTemplate/Get", { pk: pk })
}

export async function listScheduleTemplate(cond: any) {
  return await post<ScheduleTemplateModel>("ScheduleTemplate/List", cond)
}
export async function listScheduleTemplateByClass(cls: string) {
  return await get<ScheduleTemplateModel>("ScheduleTemplate/ListByClass", { dseClass: cls })
}

export async function saveScheduleTemplate(data: ScheduleTemplateModel) {
  DeconstructionKvModel(data)
  return await post<ScheduleTemplateModel>("ScheduleTemplate/Save", data)
}
export async function delScheduleTemplate(pk: string) {
  return await post<ScheduleTemplateModel>("ScheduleTemplate/Delete", { pk: pk })
}